from selenium.webdriver.common.by import By

from page_object.pages.BasePage import BasePage
from page_object.pages.ChatPage import ChatPage


class MakeOrderPage(BasePage):
    # 下单页面
    _tv_submit = (By.ID, 'tv_submit')
    _coin_payment = (By.XPATH, '//*[contains(@resource-id, "pay_name_iv") and contains(@text, "金币")]')

    def place_order(self):
        '''
        金币支付下单
        :return: 聊天页
        '''

        self.find(self._tv_submit).click()
        self.find(self._coin_payment).click()
        return ChatPage()